<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .outer {
      width: 200px;
      height: 200px;
      border: 1px solid black;
      margin: 100px auto 0;
      /* 父元素开启3d空间 */
      transform-style: preserve-3d;
      /* 设置景深(用户与元素之间的距离) */
      perspective: 500px;
    }
    .inner {
      width: 200px;
      height: 200px;
      background-color: red;
      /* 往 x 轴上旋转 30度 */
      transform: rotateX(30deg);
    }
  </style>
</head>
<body>
  <div class="outer">
    <div class="inner">hello world</div>
  </div>
</body>
</html>
